use std::string::FromUtf8Error;

use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
use uuid::Uuid;

pub struct Random;

impl Random {
    pub fn str(len: usize) -> Result<String, FromUtf8Error> {
        let x =thread_rng()
            .sample_iter(&Alphanumeric)
            .take(len);
        String::from_utf8(x.collect())
    }
    pub fn uuid_v4()->String{
        Uuid::new_v4().to_string()
    }
}
